package indi.mybatis.flying.models;

import java.util.Set;

import org.apache.ibatis.type.JdbcType;

import indi.mybatis.flying.statics.AssociationType;

/**
 * 
 * @date 2019年12月18日 11:56:08
 *
 * @author 李萌
 * @email limeng32@live.cn
 * @since JDK 1.8
 */
public interface Mapperable {

	/**
	 * get the name of the field in the entity class
	 * 
	 * @return the name of the field in the entity class
	 */
	String getFieldName();

	/**
	 * get the name of the field in the database table
	 * 
	 * @return the name of the field in the database table
	 */
	String getDbFieldName();

	/**
	 * get whether the field is a foreign key
	 * 
	 * @return whether the field is a foreign key
	 */
	boolean isForeignKey();

	/**
	 * get the foreign field name in the entity class
	 * 
	 * @return the foreign field name in the entity class
	 */
	String getForeignFieldName();

	/**
	 * get the jdbc type of the field in the database
	 * 
	 * @return the jdbc type of the field in the database
	 */
	JdbcType getJdbcType();

	/**
	 * get the association table unique key in the database
	 * 
	 * @return the association table unique key in the database
	 */
	String getDbAssociationUniqueKey();

	/**
	 * get the foreign association mappers
	 * 
	 * @return the foreign association mappers
	 */
	ForeignAssociationMapper[] getForeignAssociationMappers();

	/**
	 * get the ignore tag set
	 * 
	 * @return the ignore tag set
	 */
	Set<String> getIgnoreTagSet();

	/**
	 * get the white list tag set
	 * 
	 * @return the white list tag set
	 */
	Set<String> getWhiteListTagSet();

	/**
	 * get the type handler path
	 * 
	 * @return the type handler path
	 */
	String getTypeHandlerPath();

	/**
	 * get the field type
	 * 
	 * @return the field type
	 */
	Class<?> getFieldType();

	/**
	 * get the sub target class
	 * 
	 * @return the sub target class
	 */
	Class<?> getSubTarget();

	/**
	 * get the association type
	 * 
	 * @return the association type
	 */
	AssociationType getAssociationType();

	/**
	 * get the crypt key column
	 * 
	 * @return the crypt key column
	 */
	String[] getCryptKeyColumn();

	/**
	 * get the crypt key field
	 * 
	 * @return the crypt key field
	 */
	FieldMapper[] getCryptKeyField();

	/**
	 * get the db field name for join
	 * 
	 * @return the db field name for join
	 */
	String getDbFieldNameForJoin();

	/**
	 * get the crypt key addition
	 * 
	 * @return the crypt key addition
	 */
	String getCryptKeyAddition();

	/**
	 * get whether the field is a delegate field
	 * 
	 * @return whether the field is a delegate field
	 */
	boolean isDelegate();
}